package com.wechat.it.isales.member.service;

import java.util.ArrayList;
import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.wechat.it.isales.member.vo.MemberVO;


/**
 * Sample JAX-RS resource service
 */
@Path("/my")
public class MemberProvider {

	@GET
	@Produces("text/html")
	@Path("/get/getinfo1")
	public String getInfo1() {
		System.out.println("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
		return "Successfully accessed OAuth protected person: afdafdaf";
	}

	@GET
	@Produces("text/html")
	@Path("/get/getinfo11")
	public String getInfo1(@QueryParam("name") String name) {
		System.out.println("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
		return "Successfully accessed OAuth pr1111f" + name;
	}

	@GET
	@Produces({ MediaType.APPLICATION_XHTML_XML })
	@Path("/get/getinfo2")
	public List<MemberVO> getInfo2() {
		System.out.println("eeeeeeeeeeeeeeeeeeeeeeelisteeeeeeeeee");
		MemberVO bean = new MemberVO();
		bean.setId(111);
		bean.setName("111");

		MemberVO bean2 = new MemberVO();
		bean2.setId(222);
		bean2.setName("222汉定");

		List<MemberVO> list = new ArrayList<MemberVO>();
		list.add(bean);
		list.add(bean2);
		return list;
	}

	@GET
	@Produces({ MediaType.APPLICATION_JSON })
	@Path("/get/getinfo3")
	public MemberVO getInfo3() {
		System.out.println("eeeeeeeeeeeeeeeeeeeeeeeebeaceeeeeeeee");
		MemberVO bean = new MemberVO();
		bean.setId(111);
		bean.setName("111");

		return bean;
	}

	@GET
	@Produces({ MediaType.APPLICATION_JSON })
	@Path("/get/getinfo4")
	public List<MemberVO> getInfo4() {
		System.out.println("eeeeeeeeeeeeeeeeeeeeeeelisteeeeeeeeee");
		MemberVO bean = new MemberVO();
		bean.setId(111);
		bean.setName("111");

		MemberVO bean2 = new MemberVO();
		bean2.setId(222);
		bean2.setName("222中文");

		List<MemberVO> list = new ArrayList<MemberVO>();
		list.add(bean);
		list.add(bean2);
		return list;
	}

}
